from django.db import models
from utils.BaseModel import BaseModel
# Create your models here.
class Category(BaseModel):
    cname = models.CharField(max_length=32,verbose_name="分类名称")
    parent = models.ForeignKey("self",null=True,blank=True,on_delete=models.CASCADE,verbose_name="上级分类",related_name="children")
    ishome = models.BooleanField(default=True,verbose_name="是否推荐在首页")
    isgood = models.BooleanField(default=True,verbose_name="是否为精品课分类")
    class Meta:
        verbose_name = "课程分类"
        db_table = "category"
    def __str__(self):
        return self.cname






































































